﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Arim.S4.Client.Base.Dto
{
    public class BackgroundJobDto : EntityDto
    {
        public BackgroundJobDto()
        {
            this.CreatedAt = DateTime.Now;
        }
       
        /// <summary>
        /// Job类型
        /// </summary>
        [Display(AutoGenerateField = false)]
        public string JobType { get; set; }

        /// <summary>
        /// Job名称
        /// </summary>	
        [Display(Name = "Job名称")]
        public string Name { get; set; }

        /// <summary>
        /// 描述
        /// </summary>	
        [Display(Name = "描述")]
        public string Description { get; set; }

        /// <summary>
        /// 程序集名称(所属程序集)
        /// </summary>				

        [Display(Name = "程序集名称")]
        public string AssemblyName { get; set; }

        /// <summary>
        /// 类名(完整命名空间的类名)
        /// </summary>	
        [Display(Name = "类名")]
        public string ClassName { get; set; }

        /// <summary>
        /// 参数
        /// </summary>	
        [Display(Name = "参数")]
        [DisplayFormat(NullDisplayText = "")]
        public string JobArgs { get; set; }

        /// <summary>
        /// Cron表达式
        /// </summary>

        [Display(Name = "Cron表达式")]
        public string CronExpression { get; set; }

        [Display(Name = "执行方式")]
        /// <summary>
        /// Cron表达式描述
        /// </summary>				
        public string CronExpressionDescription { get; set; }

        /// <summary>
        /// 最后运行时间
        /// </summary>	
        [Display(Name = "最后运行时间")]
        [DisplayFormat(ConvertEmptyStringToNull = true, NullDisplayText = "")]
        public DateTime? LastRunTime { get; set; }

        /// <summary>
        /// 下次运行时间
        /// </summary>		
        [Display(Name = "下次运行时间")]
        [DisplayFormat(ConvertEmptyStringToNull = true, NullDisplayText = "")]
        public DateTime? NextRunTime { get; set; }

        /// <summary>
        /// 运行次数
        /// </summary>
        [Display(Name = "运行次数")]
        public int RunCount { get; set; }

        /// <summary>
        /// 状态  0-停止  1-运行   3-正在启动中...   5-停止中...
        /// </summary>
        [Display(Name = "当前状态")]
        public int State { get; set; }


        /// <summary>
        /// 创建日期时间
        /// </summary>		
        [Display(Name = "创建时间")]
        public DateTime CreatedAt { get; set; }

        ///// <summary>
        ///// 最后更新时间
        ///// </summary>
        [Display(Name = "更新时间", AutoGenerateField = false)]
        public DateTime? LastUpdatedAt { get; set; }
    }

}
